<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0">
    <link rel="shortcut icon" type="image/x-icon" href="assets/img/favicon.ico">
    <title>Preclinic - Medical & Hospital - Bootstrap 4 Admin Template</title>
    <link rel="stylesheet" type="text/css" href="assets/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="assets/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="assets/css/select2.min.css">
    <link rel="stylesheet" type="text/css" href="assets/css/dataTables.bootstrap4.min.css">
    <link rel="stylesheet" type="text/css" href="assets/css/bootstrap-datetimepicker.min.css">
    <link rel="stylesheet" type="text/css" href="assets/css/style.css">
    <!--[if lt IE 9]>
		<script src="assets/js/html5shiv.min.js"></script>
		<script src="assets/js/respond.min.js"></script>
	<![endif]-->
</head>

<body>
    
            <div class="content">
                <div class="row">
                    <div class="col-sm-4 col-3">
                        <h4 class="page-title">患者</h4>
                    </div>
                    <div class="col-sm-8 col-9 text-right m-b-20">
                        <a href="add-patient.html" class="btn btn btn-primary btn-rounded float-right"><i class="fa fa-plus"></i> 添加患者</a>
                    </div>
                </div>
				<div class="row">
					<div class="col-md-12">
						<div class="table-responsive">
							<table class="table table-border table-striped custom-table datatable mb-0">
								<thead>
									<tr>
										<th>姓名</th>
										<th class="text-right">年龄</th>
										<th class="text-right">住址</th>
										<th class="text-right">电话</th>
										<th class="text-right">求诊</th>
										<th class="text-right">状态</th>
										<th class="text-right">操作</th>
									</tr>
								</thead>
								<tbody id="patients">
								</tbody>
							</table>
						</div>
					</div>
                </div>
            </div>
            
    
	<script src="assets/js/jquery-3.2.1.min.js"></script>
	<script src="assets/js/popper.min.js"></script>
    <script src="assets/js/bootstrap.min.js"></script>
    <script src="assets/js/jquery.slimscroll.js"></script>
    <script src="assets/js/select2.min.js"></script>
    <script src="assets/js/jquery.dataTables.min.js"></script>
    <script src="assets/js/dataTables.bootstrap4.min.js"></script>
    <script src="assets/js/moment.min.js"></script>
    <script src="assets/js/bootstrap-datetimepicker.min.js"></script>
    <script src="assets/js/app.js"></script>
	<!--json data-->
	<script type="text/javascript" src="json/patients.json"></script>
	<script type="text/javascript">	
	$(document).ready(function () {
		var patientsStr = "";
		for(var i = 0; i < patients.length; i++){
			patientsStr = patientsStr + '<tr>';
			patientsStr = patientsStr + '<td><img width="28" height="28" src="assets/img/'+ patients[i].img +'" class="rounded-circle m-r-5" alt=""> '+ patients[i].name +'</td>';
			patientsStr = patientsStr + '<td class="text-right">'+ patients[i].age +'</td>';
			patientsStr = patientsStr + '<td class="text-right">'+ patients[i].addr +'</td>';
			patientsStr = patientsStr + '<td class="text-right">'+ patients[i].mobile +'</td>';
			patientsStr = patientsStr + '<td class="text-right">'+ patients[i].status +'</td>';
			patientsStr = patientsStr + '<td class="text-right"><a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="">'+ patients[i].modules +'</a></td>';
			patientsStr = patientsStr + '<td class="text-right">';
			patientsStr = patientsStr + '<div class="dropdown dropdown-action">';
			patientsStr = patientsStr + '<a href="#" class="action-icon dropdown-toggle" data-toggle="dropdown" aria-expanded="false"><i class="fa fa-ellipsis-v"></i></a>';
			patientsStr = patientsStr + '<div class="dropdown-menu dropdown-menu-right">';
			patientsStr = patientsStr + '<a class="dropdown-item" href="edit-patient.html"><i class="fa fa-pencil m-r-5"></i> 编辑</a>';
			patientsStr = patientsStr + '<a class="dropdown-item" href="#" data-toggle="modal" data-target="#delete_patient"><i class="fa fa-trash-o m-r-5"></i> 删除</a>';
			patientsStr = patientsStr + '</div>';
			patientsStr = patientsStr + '</div>';
			patientsStr = patientsStr + '</td>';
			patientsStr = patientsStr + '</tr>';
		}
		$("#patients").html(patientsStr);
	});
	</script>
	<!--json data-->
</body>

</html>